home *** CD-ROM | disk | FTP | other *** search
- Path: montana.avicom.net!not-for-mail
- From: cts@montana.avicom.net (Craig Spannring)
- Newsgroups: comp.lang.c++
- Subject: Re: (HUGE) Help! This bug is killing me! Anyone have any ideas?
- Date: 9 Jan 1996 23:58:06 -0700
- Organization: Avicom
- Message-ID: <4cvo1u$sdv@montana.avicom.net>
- References: <4cjmbt$gaf@maverick.tad.eds.com>
- NNTP-Posting-Host: montana.avicom.net
-
- In article <4cjmbt$gaf@maverick.tad.eds.com>,
- Darrin Smith <fignet05.darrins@eds.com> wrote:
- >Well I've spent 3 days now trying to figure out what is wrong with this
- >thing, and I've finally decided to enlist YOUR help.
-
- >*****************************************************************************
- >#include "dcmt.h"
- >
- >void main()
- >{
-
- <253 lines deleted!!!>
-
- >}
-
- To start with I would question the wisdom of having 253 lines in this
- function.
-
- <more lines deleted>
-
- > case 1 :
-
- Don't use magic numbers in your code. The people forced to maintain
- this will start carrying voodoo dolls of you around with them.
-
-
-
- >/* ##################### Text Function ################### */
- >text( char *textvar, int textfunc)
-
- Use better function header comments. In fact use better (and more)
- comments throughout the code.
-
- Do a walkthrough (with pencil and paper) of your code before you try
- running it. I know walkthroughs are an ancient technique, but they
- will find many coding errors. (It probably won't find any
- specifications or requirements errors though.)
-
- Get some tools like Bounds Checker, Purify, Code Guard, etc. These
- programs cost a few bucks in the short term, but how much does each
- three day bug your company in salary, office space, lost time to
- market, etc?
-
- Use the right tool for the job. (No flames from C/C++ fans please.) It
- looks to me (at first glance anyhow) that this converts a source files
- from one format to another. C/C++ might be a fine language for general
- purpose, but lex or something similar is specialized for your current
- task.
-
- Try to get you company to require programmers and software engineers to
- learn good techniques for design, coding, and testing. I don't just
- mean learning all the buzzwords like repeatable processes, TQM, and
- such, but really developing the skills needed to develop good
- software. Looking at your sample of code makes it evident to me that
- your company doesn't require quality products. Poor techniques
- guarantee poor software.
-
- Read books like 'Writing Solid Code', 'Software Quality Assurance' and
- others. Make an effort to apply techniques they offer. Learn from your
- mistakes. Learn from the mistakes of others.
-
- I guess I should step down from my soapbox now.
-
- --
- ===========================================================================
- Opinions expressed are soley mine and my cat's | Craig Spannring
- They do not represent the views of my employer. | cts@avicom.net
-